package java_012_zuoye01;

import java.util.ArrayList;

public class java13 {
	public static void main(String[] args) {
		ArrayList<Integer> list =new ArrayList<Integer>();
		list.add(10);list.add(20);list.add(30);
		printList(list);
		printListAt(list);
	}

	private static void printListAt(ArrayList<Integer> list) {
		System.out.print("{");
		for (int i=0;i<list.size();i++){
			if(i==list.size()-1){
				System.out.print(list.get(i));
			}else{
				System.out.print(list.get(i));
				System.out.print("@");
			}
			
		}
		System.out.println("}");
	}

	private static void printList(ArrayList<Integer> list) {
		System.out.print("[");
		for (int i=0;i<list.size();i++){
			if(i==list.size()-1){
				System.out.print(list.get(i));
			}else{
				System.out.print(list.get(i)+",");
			}
		}
		System.out.println("]");
	}
}
